<{*通用文件头*}>
<!doctype html>
<html>
<head>
    <meta charset="utf-8">
    <meta content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=no" name="viewport">
    <meta content="yes" name="apple-mobile-web-app-capable">
    <meta content="black" name="apple-mobile-web-app-status-bar-style">
    <meta content="telephone=no" name="format-detection">
    <meta content="email=no" name="format-detection">
    <title><{$title}></title>
    <link rel="stylesheet" type="text/css" href="<{$preStaticUrl}>Wap/css/style.css?v=<{$resVersion}>"/>
    <{* <link rel="stylesheet" type="text/css" href="<{$preStaticUrl}>Wap/css/diff_<{$displayScheme}>.css?v=<{$resVersion}>"/> *}>
    <script src="<{$preStaticUrl}>Wap/js/flexible.js?v=<{$resVersion}>"></script>
    <script src="<{$preStaticUrl}>Wap/js/jquery-2.1.4.min.js?v=<{$resVersion}>"></script>
    <script src="<{$preStaticUrl}>Wap/js/tck.js?v=<{$resVersion}>"></script>
    <script src="<{$preStaticUrl}>Wap/js/float_zxx.js?v=<{$resVersion}>"></script>
    <script src="<{$preStaticUrl}>Wap/js/common.js?v=<{$resVersion}>"></script>
    <script src="<{$preStaticUrl}>layer/layer.js?v=<{$resVersion}>"></script>

<script>
    var CurrentPlantform='<{$plantform}>';
</script>
<{if $isWechat }>
    <script src=" https://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
    <script>
        wx.config({
            debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来，若要查看传入的参数，可以在pc端打开，参数信息会通过log打出，仅在pc端时才会打印。
            appId: "<{$wxSign.appId}>", // 必填，公众号的唯一标识
            timestamp: "<{$wxSign.timestamp}>", // 必填，生成签名的时间戳
            nonceStr: "<{$wxSign.nonceStr}>", // 必填，生成签名的随机串
            signature:"<{$wxSign.signature}>",// 必填，签名，见附录1
            jsApiList: [
                'checkJsApi',
                'chooseWXPay',
                <{if $isWxShare}>
                    'onMenuShareTimeline',
                    'onMenuShareAppMessage',
                <{/if}>
                'addCard',
                'scanQRCode'
            ] // 必填，需要使用的JS接口列表，所有JS接口列表见附录2
        });
        <{if $isWxShare}>
            var shareData = {
                title:"<{$wxTitle}>",
                desc: "<{$wxDesc|default:$wxTitle}>",
                link: "<{$wxLink}>",
                imgUrl: "<{$wxImage}>",
                trigger: function (res) {
                // 不要尝试在trigger中使用ajax异步请求修改本次分享的内容，因为客户端分享操作是一个同步操作，这时候使用ajax的回包会还没有返回
                // alert('用户点击发送给朋友');
                },
                success: function (res) {
                    var objType = "<{$wxObjType}>";
                    var objID = "<{$wxObjID}>";
                    var param = {objType:objType,objID:objID};
                    $.getJSON("<{U('User/weixinDayFirstShare')}>",param,function(result){
                        console.log(result);
                        if(result.status == 0 ){
                            layer.msg(result.tip,{shift:5,offset:$(window).height() * 0.8});
                        } else{
        //                    layer.msg(result.msg,{shift:5,offset:$(window).height() * 0.8});
                        }
                    })
                },
                cancel: function (res) {
                    // alert('已取消');
                    layer.msg('已取消',{shift:5,offset:$(window).height() * 0.8});
                },
                fail: function (res) {
                    // alert(JSON.stringify(res));
                    layer.msg('分享失败',{shift:5,offset:$(window).height() * 0.8});
                }
            };
        <{/if}>

        var canpay=false;
        wx.ready(function () {

            <{if $isWxShare}>
                wx.onMenuShareAppMessage(shareData);
                wx.onMenuShareTimeline(shareData);
            <{/if}>
            <{if $hasUnreceive eq 1}>
                wx.addCard({
                    cardList: [{
                    cardId:  '<{$wxCardId}>',
                    cardExt: '<{$cardExt}>'
                }], // 需要添加的卡券列表
                success: function (res) {
                },
                cancel: function (res) {
                }
                });
            <{/if}>
            canpay=true;
        });
    </script>
<{/if}>


    <script>
        var _hmt = _hmt || [];
        (function() {
            var hm = document.createElement("script");
            hm.src = "https://hm.baidu.com/hm.js?b3ba33676142ee633064a3d2a162f9d1";
            var s = document.getElementsByTagName("script")[0];
            s.parentNode.insertBefore(hm, s);
        })();
    </script>
